<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      >

<h:head>

<title>Création d'utilisateur</title>
</h:head>
<h:body rendered="#{personneBean.sessionPersonne.idPersonne eq 0}" style="background-color:grey;">
<div>
	<img src="Ressources/progestion_banniere.png" width="40%" style="display:block;margin-left:auto;margin-right:auto;" alt="Progestion"/>
	<h:form>
		<p:menubar>
			<p:menuitem ajax="false" action="userAdministration" value="Retour à l'administration"/>
			<p:menuitem ajax="false" action="#{personneBean.doLogout}" value="Deconnexion"/>
		</p:menubar>
	</h:form>
</div>
<h:form>
	<p:messages autoUpdate="true"></p:messages>
	<h:panelGrid columns="3">
		<h:outputLabel value="Nom" for="nomPersonne" />
		<p:inputText id="nomPersonne" value="#{sessionScope.personneBean.administrationPersonne.nomPersonne}" label="Nom" maxlength="255" required="true"/>
		<p:message for="nomPersonne" />
		<h:outputLabel value="Prénom" for="prenomPersonne" />
		<p:inputText id="prenomPersonne" value="#{sessionScope.personneBean.administrationPersonne.prenomPersonne}" label="Prénom" maxlength="255" required="true"/>
		<p:message for="prenomPersonne" />
		<h:outputLabel value="Login" for="loginPersonneToCreate" />
		<p:inputText id="loginPersonneToCreate" value="#{sessionScope.personneBean.administrationPersonne.loginPersonne}" maxlength="255" required="true"/>
		<p:message for="loginPersonneToCreate" />
		<h:outputLabel value="Mot de passe" for="passwordPersonneToCreate" />
		<p:password id="passwordPersonneToCreate" value="#{sessionScope.personneBean.administrationPersonne.passwordPersonne}" maxlength="255" required="true"/>
		<p:message for="passwordPersonneToCreate" />
	</h:panelGrid>
	<p:commandButton ajax="false" action="#{sessionScope.personneBean.administrationPersonne.doCreate}" value="Créer" />
</h:form>
</h:body>
<h:body rendered="#{personneBean.sessionPersonne.idPersonne ne 0}" onload="window.location.replace( 'login.xhtml' )">
</h:body>
</html>